<div class="modal fade bs-modal-lg" id="modelContent">
	<div class="modal-dialog modal-lg">
        <div class="modal-content"></div>
    </div>
</div> 
<div class="portlet box green">
    <div class="portlet-title">
		<div class="caption"><i class="fa fa-cogs"></i>数据列表</div>
		<div class="tools"><a href="javascript:;" class="collapse" data-original-title="" title=""> </a></div>
		<div class="actions">
		<a href="#modelContent" thref="/companyCata/add" class="btn white btn-sm ajax-model-get" data-toggle="modal"><i class="fa fa-plus"></i> 新增 </a>
		
		<a class="btn white btn-sm  "  href="javascript:;" onclick="jQuery('#tableCategory').treetable('expandAll'); return false;"><i class="fa fa-expand"></i>展开</a>
        <a  class="btn white btn-sm  " href="javascript:;" onclick="jQuery('#tableCategory').treetable('collapseAll'); return false;"><i class="fa fa-compress"></i>折叠</a>
		</div>
    </div>
    <div class="portlet-body">
	    	<div class="form-group">
				<div class="alert alert-warning">
					<strong> 注：</strong>
				 	货品分类用于货品新增和页面导航类目显示的筛选条件，其为货品的性质分类，不显示在前台页面。
				</div>
			</div>
			<div class="table-container table-scrollable">
			    <table class="table table-striped table-bordered table-hover" id="tableCategory">
				  	<thead>
						<tr>
		   		 			<th>分类名称</th>
		   		 			<th>启用</th>
		   		 			<th>排序</th>
		   		 			<th>创建时间</th>
							<th class="col-md-2">操作</th>
						</tr>
					</thead>
					<tbody>
					#foreach($item in $cataList)
		  				<tr data-tt-id="$!item.id"  status='$!item.status' data-tt-parent-id="$!item.pid" id="$!item.id">  
						    <td>$!item.name</td>
						    <td>#if($!item.status=='true')
						    	<span class="glyphicon glyphicon-ok-circle" style="color: lightgreen">
						    	#end
						    	#if($!item.status=='false')
						    	<span class="glyphicon glyphicon-remove-circle" style="color: red">
						    	#end
						    </td>
						    <td>$!item.sort</td>
						    <td>$!item.createTime</td>
			    			<td nowrap="nowrap">
						    	<a class="btn green btn-outline btn-sm ajax-model-get" data-toggle="modal" href="#modelContent" thref="/companyCata/edit?id=$!item.id&"> 
									<i class="fa fa-edit"></i>修改
								</a>
								
								#if($!item.id != 14 && $!item.id != 12)
								
								#if(!$!item.status=='true')
								<a class="btn green btn-outline btn-sm ajax-delete"  href="javascript:;" thref="/companyCata/delete?id=$!item.id">
									<i class="fa fa-trash"></i>删除
								</a>
								#else
								<a class="btn green btn-outline btn-sm" 
									href="javascript:;" onclick="alert('启用状态不能删除')"><i class="fa fa-trash"></i>删除
								</a>
								#end
								#if($!item.level == 1 || $!item.level == 2 || $!item.level == 3 )
								<a href="#modelContent" thref="/companyCata/add?id=$!item.id" class="btn green btn-outline btn-sm ajax-model-get"  data-toggle="modal">
								<i class="fa fa-edit"></i>新增下级分类</a>
	    						#end
	    						#end
						    </td>		  			
		  				</tr>
					#end
					</tbody>
			 </table>
		 </div>
    </div>
</div>
<script type="text/javascript" src="/assets/scripts/views-treetable.js"></script>
<script type="text/javascript">
$("input[name= name]").focus();
</script>
